package com.tencreat.domain.mall;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tencreat.common.annotation.Excel;
import com.tencreat.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;


/**
 * 收货地址对象 mall_address
 *
 * @author tencreat
 * @date 2021-08-19
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
@TableName("mall_address")
public class MallAddress extends BaseEntity<MallAddress>{
    private static final long serialVersionUID = 1L;


    /** $column.columnComment */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "ID")
    private Long id;


    /** 收货人名称 */
    @Excel(name = "收件人名称",sort = 3)
    @ApiModelProperty(value= "收货人名称")
    @TableField("`name`")
    private String name;


    /** 用户表的用户ID */
    @Excel(name = "用户ID",sort = 1)
    @ApiModelProperty(value= "用户表的用户ID")
    @TableField("`uuid`")
    private Long uuid;

    @TableField(exist = false)
    @Excel(name = "手机号码",sort = 2)
    @ApiModelProperty(value= "手机号码")
    private String mobile;

    /** 行政区域表的省ID */
//    @Excel(name = "行政区域表的省ID")
    @ApiModelProperty(value= "行政区域表的省ID")
    @TableField("`province`")
    private String province;

    /** 行政区域表的省名称 */
    @ApiModelProperty(value= "行政区域表的省名称")
    @TableField("`province_name`")
    private String provinceName;


    /** 行政区域表的市ID */
//    @Excel(name = "行政区域表的市ID")
    @ApiModelProperty(value= "行政区域表的市ID")
    @TableField("`city`")
    private String city;

    /** 行政区域表的市名称 */
    @ApiModelProperty(value= "行政区域表的市名称")
    @TableField("`city_name`")
    private String cityName;

    /** 行政区域表的区县ID */
//    @Excel(name = "行政区域表的区县ID")
    @ApiModelProperty(value= "行政区域表的区县ID")
    @TableField("`county`")
    private String county;

    /** 行政区域表的区县名称 */
    @ApiModelProperty(value= "行政区域表的区县名称")
    @TableField("`county_name`")
    private String countyName;

    /** 详细收货地址 */
    @Excel(name = "详细收货地址",sort = 6)
    @ApiModelProperty(value= "详细收货地址")
    @TableField("`address_detail`")
    private String addressDetail;


    /** 地区编码 */
//    @Excel(name = "地区编码")
    @ApiModelProperty(value= "地区编码")
    @TableField("`area_code`")
    private String areaCode;


    /** 邮政编码 */
//    @Excel(name = "邮政编码")
    @ApiModelProperty(value= "邮政编码")
    @TableField("`postal_code`")
    private String postalCode;


    /** 手机号码 */
    @Excel(name = "收件人手机号码",sort = 4)
    @ApiModelProperty(value= "收件人手机号码")
    @TableField("`tel`")
    private String tel;


    /** 是否默认地址 */
    @Excel(name = "默认地址", sort = 7, readConverterExp = "0=否,1=是")
    @ApiModelProperty(value= "是否默认地址")
    @TableField("`is_default`")
    private Integer isDefault;


    /** 删除标志（0代表存在 2代表删除） */
    @TableLogic
    @TableField("`del_flag`")
    private String delFlag;

    @ApiModelProperty("创建时间")
    @Excel(name = "创建时间", dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 8)
    @TableField(exist = false)
    private LocalDateTime createTime2;


    /** 租户ID */
//    @Excel(name = "租户ID")
    @ApiModelProperty(value= "租户ID")
    @TableField("`tenant_id`")
    private Long tenantId;

    @Excel(name = "省市区",sort =5)
    @ApiModelProperty(value = "省市区拼接")
    @TableField(exist = false)
    private String areasName;

    /**
     *   收货人手机号码
     */
    @TableField(exist = false)
    @ApiModelProperty(value= "收货人手机号码")
    private String shippingTel;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false)
    private LocalDateTime startTime;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false)
    private LocalDateTime endTime;
}
